package net.pm.core.web.material;

import java.util.List;

import javax.annotation.Resource;

import net.pm.core.entities.db.Materiallog;
import net.pm.core.service.MateriallogServicer;
import net.pm.core.web.BaseController;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@Scope("request")
@RequestMapping("/materiallog/")
public class MateriallogController extends BaseController {

	@Resource(name="MateriallogServicer")
	private MateriallogServicer materiallogServicer;
	
	/**
	 * 查看产品的领料记录
	 * @param productId
	 * @return
	 */
	@RequestMapping(value="list",method=RequestMethod.GET)
	public ModelAndView list(Long productId){
		List<Materiallog>  materiallogs = materiallogServicer.findMaterialogByProductId(productId);
		return new ModelAndView("materiallog/materiallog_list","materiallogs",materiallogs);
	}
	
}
